#pragma config(Sensor, dgtl1,  stopButton,     sensorTouch)
#pragma config(Motor,  port2,           frontRightMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor,  port3,           backRightMotor, tmotorServoContinuousRotation, openLoop)
#pragma config(Motor,  port4,           frontLeftMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor,  port5,           backLeftMotor, tmotorServoContinuousRotation, openLoop, reversed)
#pragma config(Motor,  port6,           armMotor,      tmotorServoContinuousRotation, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

//+++++++++++++++++++++++++++++++++++++++++++++| MAIN |+++++++++++++++++++++++++++++++++++++++++++++++

task main()
{
	int buttonpressed=SensorValue(stopButton);

	while(true)
	{
		buttonpressed=SensorValue(stopButton);

		while (buttonpressed == 0)
		{
			//Remote control setting
			motor[frontRightMotor] = vexRT[Ch2];
			motor[backRightMotor]  = vexRT[Ch2]; //Left side of the robot is controlled by the left joystick, Y-axis
			motor[frontLeftMotor] = vexRT[Ch3];
			motor[backLeftMotor]  = vexRT[Ch3];

			buttonpressed=SensorValue(stopButton);
		}

		if(vexRT[Btn5U] == 1)       	//If button 5U is pressed...
		{
			motor[armMotor] = 127;    	//...raise the arm.
		}
		else if(vexRT[Btn5D] == 1)  	//Else, if button 5D is pressed...
		{
			motor[armMotor] = -127;   	//...lower the arm.
		}

		motor[frontRightMotor] = -10; //Tells all of the motors to go backwards a tiny bit, and waits 0.75 seconds.
		motor[backRightMotor]  = -10;
		motor[frontLeftMotor] = -10;
		motor[backLeftMotor]  = -10;
		motor[armMotor] = 0;
		wait1Msec(750);

		motor[frontRightMotor] = 0; //Tells all of the motors to stop, and waits 1 seconds.
		motor[backRightMotor]  = 0;
		motor[frontLeftMotor] = 0;
		motor[backLeftMotor]  = 0;
		motor[armMotor] = 0;

		wait1Msec(1000);

	}
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


//+++++++++++++++++++++++++++++++++++++++++++++| Notes |+++++++++++++++++++++++++++++++++++++++++++++++

//Code by Conlan and the VEX team//

//News:

//Nothing much...

//Todo:

//Start working on autonomus
//Add Encoders


//Note to devs: Every release, delete and add what you have added/changed/removed.
